<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>导航条练习</title>
		
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			
			#nav{
				/*去除列表的标号*/
				list-style: none;
				width: 1000px;
				margin: 10px auto;
				background-color: cornflowerblue;
				/*结果高度塌陷*/
				overflow: hidden;
				
			}
			
			#nav > li{
				width: 25%;
				float: left;
				
			}
			
			#nav a{	
				/*a元素转为块元素*/
				display: block;
				width: 100%;
				font: 20px "微软雅黑";
				color: white;	
				text-align: center;
				/*去掉下划线*/
				text-decoration: none;
				/*字体加粗*/
				font-weight: bold;
				padding: 5px;
			}
			
			/*伪类  设置鼠标经过链接时的颜色*/
			#nav a:hover{
				background-color: crimson;
			}
		</style>
	</head>
	<body>
		<ul id="nav">
			<li>
				<a href="#">新闻</a>
			</li>
			<li>
				<a href="#">娱乐</a>
			</li>
			<li>
				<a href="#">体育</a>
			</li>
			<li>
				<a href="index.html">主页</a>
			</li>
		</ul>
	</body>
</html>
